package command;

import object.Commit;
import object.HEAD;

public class LogCommand {
    Commit commit;

    public LogCommand() throws Exception {
        HEAD head = HEAD.deserialize();
        commit = Commit.deserialize(head.getKey());

    }

    public void excute() throws Exception {
        if (commit != null) {
            System.out.println(commit.getContent());
            System.out.println("------------------------");
            while( commit.getParent() != ""){
                commit = Commit.deserialize(commit.getParent());
                System.out.println(commit.getContent());
                System.out.println("------------------------");
            }
        }
    }
}
